package org.darkforest.common.services.impl;

import org.darkforest.common.services.BaseService;
import org.darkforest.dao.dao.GeneralDao;
import org.springframework.stereotype.Service;

/**
 * Created by pizazz on 9/29/15.
 */
@Service
public abstract class BaseServiceImpl<T, E> implements BaseService<T> {

    public abstract GeneralDao<T, E> getDao();

    @Override
    public int deleteByPrimaryKey(Integer primaryKey) {
        return getDao().deleteByPrimaryKey(primaryKey);
    }

    @Override
    public int insert(T object) {
        return getDao().insert(object);
    }

    @Override
    public int insertSelective(T object) {
        return getDao().insert(object);
    }

    @Override
    public T selectByPrimaryKey(Integer primaryKey) {
        return getDao().selectByPrimaryKey(primaryKey);
    }

    @Override
    public int updateByPrimaryKeySelective(T object) {
        return getDao().updateByPrimaryKeySelective(object);
    }

    @Override
    public int updateByPrimaryKey(T object) {
        return getDao().updateByPrimaryKey(object);
    }

}
